package com.qdlc.p2p.biz.executer.impl;

import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.qdlc.p2p.biz.executer.BaseExecuter;
import com.qdlc.p2p.biz.service.ExperienceTenderService;
import com.qdlc.p2p.common.constant.Global;
import com.qdlc.p2p.common.constant.LogTplNid;
import com.qdlc.p2p.common.util.BeanUtil;
import com.qdlc.p2p.dal.dto.BorrowTender;

/**
 * 撤标-体验券业务处理
 *
 * @author xxx
 * @version 2.0
 * @date 2015年4月27日 下午6:50:03
 */
@Service
@Scope(value=ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class ExperienceCancelTenderExecuter extends BaseExecuter {

    private String accountLogType = LogTplNid.EXPERIENCE_BACK_CANCEL_TENDER;

    @Override
    public String getAccountLogType() {
        return accountLogType;
    }

    @Override
    public void extend() {
        Object obj = Global.getTransfer().get("tender");
        if (obj != null) {
            BorrowTender tender = (BorrowTender) obj;
            ExperienceTenderService experienceTenderService = (ExperienceTenderService) BeanUtil.getBean("experienceTenderService");
            experienceTenderService.experienceFullFail(tender, getAccountLogType());
        }
    }
}
